global input "Q:\dc1prhcmsas01\PU2\data - sas"
global temp "Q:\dc1prhcmsas01\PU2\temp_stata_wr"
global log "Q:\dc1prhcmsas01\PU2\Log - Stata WR"
global output "Q:\dc1prhcmsas01\PU2\data_stata_wr"
global graphs "Q:\dc1prhcmsas01\PU2\graphs_stata_wr"
global tables "Q:\dc1prhcmsas01\PU2\tables_stata_wr"

set scheme plotplain
graph set window fontface "Times New Roman"

capture log close
log using "$log/7_plot_reg_growth_ot_labels", replace

*Program to estimate regressions
cap program drop plot_est
program define plot_est 
args var name ytitle ylabel

	*Save estimates
	use "$output/`name'_estimates.dta", clear
	
	if "`var'"=="retire" | "`var'"=="health" {
		drop if event_time<-11
	}
	
	*Plot estimates
	graph twoway (connect beta event_time, lc(black) mcolor(black) legend(off)) (rcap ub lb event_time, color(black) legend(off)) , ///
		xline(-7 0) xtitle("Months since Dec 2016") xlabel(-20(5)20) ///
		yline(0) ytitle(`ytitle') ylabel(`ylabel') legend(off)
	graph export "$graphs/`name'_label.eps", replace
	graph export "$graphs/`name'_label.jpg", replace	
end 

****************************************
*Plots based on Dec 2016 Characteristics
****************************************
*Fig 5b
	plot_est ot fig5b_ot_apr "Weekly OT Pay (Dollars)" -5(1)5	
